package com.example.shengyin.service;

import com.example.shengyin.dao.SymtypeMapper;
import com.example.shengyin.entity.Page;
import com.example.shengyin.entity.Symtype;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SymtypeService {
    @Autowired
    private SymtypeMapper dao;

    public List<Symtype> list(Page page){
        return dao.list((page.getPage()-1)*page.getLimit(),page.getLimit());
    }

    public List<Symtype> allSymtyp(){
        return dao.allSymtyp();
    }

    public int insert(Symtype symtype){
        return dao.insert(symtype);
    }

    public int update(Symtype Symtype){
        return dao.update(Symtype);
    }

    public int delete(@Param("id") Long id){
        return dao.delete(id);
    }

    public int deleteByIds(@Param("ids") String ids){
        return deleteByIds(ids);
    }

    public int count(){
        return dao.count();
    }

    public int updateIsvalid(@Param("isvalid")boolean isvalid,@Param("id")Long id){
        return dao.updateIsvalid(isvalid,id);
    }

    public Symtype select(@Param("id")Long id){
        return dao.select(id);
    }


}
